package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.User;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.HashMap;

/**
 * @Author: XJH
 * @Description: TODO
 * @Date: 2025/6/7 17:32
 * @Version: 1.0
 */
@Mapper
public interface UserMapper {
    /**
     * 根据openid查询用户
     *
     * @param openid
     * @return
     */
    @Select("select * from user where openid=#{openid}")
   User getByOpenid(String openid);

    /**
     *
     * @param user
     */

    void insert(User user);

    /**
     *
     * @param userId
     * @return
     */
    @Select("select * from user where id=#{id}")
    User getById(Long userId);

    /**
     *动态查询条件
     * @param map
     * @return
     */
    Integer countByMap(HashMap map);
}
